<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="name here">
	<meta name="author" content="name here">
	
	<title>Title here</title>
	
	<link rel="stylesheet" href="css/jquery.mobile.structure-1.3.0.css">
	<link rel="stylesheet" href="themes/BancoDelPeru.css">
	
	<script src="js/jquery-1.9.1.js"></script>
	<script src="js/jquery.mobile-1.3.0.js"></script>
	<script type="text/javascript" src="js/cordova-2.5.0.js" charset="utf-8"></script>
	<script src="js/configs.js"></script>


	<script type="text/javascript" charset="utf-8">
	
	$.ajaxSetup({ cache: false });
	var accounttype="1";
	

	
	function checkDeposit(){	
 		var x = $("#text-3").val();		
 		$("#txtVerifyAmount").val(x);
		document.getElementById("amountInput").reset();		
	}

	
	function sendDeposit(){
    	
    	var cust= window.localStorage["customerID"];
    	var typetransaction=1;
	    var amount = $("#txtVerifyAmount").val();
	    
		console.log("xxxxxxxxxx " + cust);		
		console.log("xxxxxxxxxx " + typetransaction);
		console.log("xxxxxxxxxx " + amount);		
		
		 $.post("http://"+SERVER_IP_ADDRESS+":8080/WebBancoPeru/rest/transaction/deposit", {AccountType: accounttype , Amount: amount, TypeTransaction: typetransaction, Customerid: cust}, function(data){	    		
			      	 
	        if ( "true" == data.status ) {
	        	alert("Done  !!!!!");
	        	window.location.assign("success.html")
	        	
	        } else {
	        	alert("Error");
	        } 
	        	
    	}, "json");
		 
		
    }
	
	function savetype(type){
		accounttype=type;
				
	}

	</script>
</head>
<body>

	<div data-role="header" data-position="fixed">		
		<h1>Banco del Per&uacute;</h1>
	</div>
		
<div data-role="collapsible-set" data-corners="true" data-theme="c" data-content-theme="d">
    <div data-role="collapsible">
        <h3>Account Type</h3>
        <form>
			<fieldset data-role="controlgroup" data-type="horizontal">
			
			<input type="radio" name="unique_selection" id="checka" value="off" onclick="savetype('1')" checked="checked">
			<label for="checka">Checking</label>
			
			<input type="radio" name="unique_selection" id="savea" onclick="savetype('2')" value="other">
			<label for="savea">Savings</label>
			</fieldset>
		</form>
		    
    </div>
</div>

	<div data-role="header" data-position="fixed">		
			<h1>DEPOSIT SETTINGS</h1>
	</div>
	
	<form id="amountInput">
     <label for="text-1">DEPOSIT AMOUNT</label>
        
     <input type="number" data-clear-btn="true" name="text-3" id="text-3" value="">
	</form>
	
	<div data-role="content">
			<p>PRESS HERE TO DEPOSIT</p>
			
			
			<a href="#question" data-rel="popup" data-role="button" data-inline="true" data-transition="flow" onclick="checkDeposit()">Deposit</a>
			<a href="mainmenu.html" data-role="button" data-inline="true" data-mini="false" data-shadow="false">Go back to Menu</a>
			<div data-role="popup" id="question">
			
			
			
			

				<p>Is this the correct Amount:</p>
				<input type="text" id="txtVerifyAmount"/>
				
				<a href="#" onclick="sendDeposit()" data-role="button" data-inline="true">Yes</a>
				<a href="deposit.html" data-role="button" data-inline="true" data-mini="false" data-shadow="false">No</a>
		</div>
</div>
	
</body>

</html>	|